package Offer2017;

/**
 * 二叉树的镜像
 * Created by 雷文康 on 2017/12/31.
 */
public class Test19 {
    public static void mirrorTree(TreeNode root){
        if (root == null) {
            return;
        }
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
        if (root.left != null){
            mirrorTree(root.left);
        }
        if (root.right != null){
            mirrorTree(root.right);
        }
    }

}
